# 4-5 用for循环语句以及切片方法设计一个程序，找出100000以内的所有回文数
def palindromes(num):
    # 将数字转换成字符串
    str_num = str(num)
    # 检查字符串和反转后的字符串是否一样
    return str_num == str_num[::-1]
# 定义一个列表
palindromes_num = []
for num in range(100000):
    if palindromes(num):
        palindromes_num.append(num)
print(palindromes_num)